﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;



namespace WebPeajes.Paginas
{
    public partial class ClasificacionVehicular : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

            }
        }

        protected void BtnAceptar_Click(object sender, EventArgs e)
        {
            string valor;
            if (ddlVehiculos.SelectedValue == "1")
            {
                if (txtPlaca.Text != "")
                {
                    valor = txtPlaca.Text;
                    Response.Redirect("RegistrarCobro.aspx?placa=" + valor);
                }
                else
                {
                    lblMensaje.Text = "Ingrese Placa/Tarjeta";
                }
            }
            else
            {
                if (ddlVehiculos.SelectedValue == "2")
                {
                    if (txtPlacaTarjeta.Text != "")
                    {
                        valor = txtPlacaTarjeta.Text;
                        Response.Redirect("RegistrarCobro.aspx?placa=" + valor);    
                    }
                    else
                    {
                        valor = txtPlacaTarjeta.Text;
                        Response.Redirect("RegistrarCobro.aspx?placa=" + valor);
                    }                    
                }
            }

        }

        protected void ddlVehiculos_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlVehiculos.SelectedValue == "1")
            {
                txtPlaca.Enabled = true;
                txtPlacaTarjeta.Enabled = false;
                lblMensaje.Text = "";
                txtPlaca.Focus();
            }
            else 
            {
                if (ddlVehiculos.SelectedValue == "2")
                {
                    txtPlacaTarjeta.Enabled = true;
                    txtPlaca.Enabled = false;
                    lblMensaje.Text = "";
                    txtPlacaTarjeta.Focus();
                }
                else
                {
                    txtPlacaTarjeta.Enabled = false;
                    txtPlaca.Enabled = false;
                    lblMensaje.Text = "";
                }
            }
        }
    }
}